﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileUpload.aspx.cs" Inherits="shfa.snomtastic.admin.controls.FileUpload" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>File Upload</title>

    <script language="javascript" type="text/javascript">
     function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

    function returnToParent()
        {
             //create the argument that will be returned to the parent page
             var oArg = new Object();
            
            //get the filename
            oArg.fileName = document.getElementById("hfUploadedFile").value;
            
            if (oArg.fileName)
            {
                var oWnd = GetRadWindow();
                oWnd.close(oArg);
            }
        }

    </script>

</head>
<body onload="returnToParent()">
    <form id="form1" runat="server">
    <table style="width: 100%">
        <tr>
            <td style="width: 100%">
                <asp:FileUpload ID="fuFirmware" runat="server" Width="100%" />
                </td>
            <td>
                <asp:ImageButton ID="ibUpload" runat="server" ImageUrl="~/images/icons/save.png"
                    OnClick="ibUpload_Click" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hfUploadedFile" runat="server" />
    </form>
</body>
</html>
